package com.fulu.game.bi.entity.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 分组关联表
 */
@Getter
@AllArgsConstructor
public enum GroupRelTableEnum {
    LABEL(1,"t_label_group_rel"),
    REGISTER_SOURCE(2,"t_register_source_group_rel"),
    ROLE_PERMISSION(3,"t_role_permission_rel"),
    USER_ROLE(4,"t_user_role_rel"),
    ;

    private Integer type;
    private String name;

    public static GroupRelTableEnum getEnum(Integer type) {
        for(GroupRelTableEnum e :  GroupRelTableEnum.values()){
            if(Objects.equals(e.getType(),type)){
                return e;
            }
        }
        return null;
    }
}
